package siar.web.realm;

import java.util.Map;

import javax.security.auth.Subject;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.login.LoginException;

import com.sun.appserv.security.AppservPasswordLoginModule;

public class SIARLoginModule extends AppservPasswordLoginModule {

	@Override
	protected void authenticateUser() throws LoginException {
		SIARRealm realm = (SIARRealm) _currentRealm;

        /*if (!_username.contains(realm.getUserCriteria())) {
            throw new LoginException ("Invalid credentials.");
        } else {
            logit("XXXX: MyLoginModule.authenticate ==>  valid credentials.... User Authenticated!");
        }

        Set principals = _subject.getPrincipals();
        principals.add(new PrincipalImpl(_username));

         String grpList[] = new String[1];
         grpList[0] = "User";
         this.commitUserAuthentication(grpList);*/

	}

	/*@Override
	public void initialize(Subject arg0, CallbackHandler arg1, Map<String, ?> arg2, Map<String, ?> arg3) {
		// TODO Auto-generated method stub
		System.out.println();

	}*/

}
